<title>邀请注册</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<script type="text/javascript" src="#(assets)/js/jquery-2.2.4.min.js"></script>
<script type="text/javascript" src="#(assets)/js/jquery.tmpl.min.js"></script>
<script type="text/javascript" src="#(assets)/js/elink.js"></script>
<script type="text/javascript" src="#(assets)/js/layer/layer.js"></script>
<style> 
	body{font-family:"Microsoft YaHei",Arial,Helvetica,sans-serif,"宋体";}
	*{margin:0;padding:0;} 
	li{list-style-type:none;}
	select,input{-webkit-appearance:none;border:0px;
		-webkit-tap-highlight-color: rgba(0, 0, 0, 0);   
	} 
</style>
<body  bgcolor="#fe4d67" style="margin:0px;">
	<img style="width:100%;" src="#(path)/assets/app/regback1.jpg">
	<div align="center" style="100%">
		<div align="center"  style="width:80%;clear:both;">
			<div style="border-bottom:1px solid #dadada;width:100%;height:50px;">
				<input placeholder="手机号" id="mobile" style="padding-left:15px;height:50px;width:100%;border-radius:10px 10px 0 0;font-size:16px;" type="tel"  />
			</div>
			<div style="width:100%;border-bottom:1px solid #dadada;height:50px;">
				<input placeholder="验证码" id="code" style="float:left;padding-left:15px;height:50px;width:60%;font-size:16px;border:0px;border-radius:0 0 0 0;" type="tel"  />
				<input id="log_getcode" style="float:right;border:0px;border-radius:0 0 0 0;color:#fd4f68;height:50px;width:40%;font-size:16px;background:#FFF" value="获取验证码" type="button"  />
			</div>
			<div style="width:100%;height:50px;">
				<input placeholder="密码" id="password" style="padding-left:15px;height:50px;width:100%;font-size:16px;border-radius:0 0 10px 10px;;border:0px;" type="password"  />
			</div>
		</div>
	</div> 
	<div align="center" style="margin-top:5px;line-height:20px;">
		<input id="xieyicheck" type="checkbox" style="vertical-align:middle;-webkit-appearance:checkbox;border:1px solid #000;height:15px;width:15px;" value="" />
		<a style="font-size:13px;">注册账户表示您同意</a>
		<a id="xieyi" style="font-size:13px;color:#FFF;text-decoration:underline">《用户注册及服务协议》</a>
	</div>
	<div align="center"><img id="reg_trueimg" style="width:50px;margin-top:10px;" src="#(path)/assets/app/sumbit.png"></div>
	
	<img style="width:100%;" src="#(path)/assets/app/regback3.jpg">
</body>
<script src="https://pv.sohu.com/cityjson?ie=utf-8"></script> 
<script>
	var ip_l=returnCitySN["cip"];
	console.log(ip_l);
	var type = "login";
	var contents = "";
	var referee = GetRequest().referee;
	console.log(referee);
	//查看协议
	$.getJSON("#(path)/notice/statement?type=userAgreement", function(data1) {
		console.log(data1);
		contents = data1.data.item.contents;
	});
	$("#xieyi").click( function(){
		layer.open({
		  type: 1,
		  title:'用户注册及服务协议',
		  closeBtn: 1,
		  shadeClose: true,
		  skin: '#FFF',
		  content: '<div style="padding:10px">'+contents+'</div>'
		});
	});
	//提交
	$("#reg_trueimg").click( function(){
		if($('#xieyicheck').is(':checked')) {
			ajax("/user/reg",{"ip":ip_l,"mobile":$("#mobile").val(),"sms":$("#code").val(),"referee":referee,"password":$("#password").val(),"type":"wx"},function(data){
				if(data.code=='success'){
					layer.msg(data.msg,{icon:1,time:1000},function(){
						window.location.href="/app/page/help-download";
					}); 
				}else{
					layer.msg(data.msg,{icon:2,time:2000}); 
				}
			});
		}else{
			layer.msg("请确认已经阅读并同意《旺进财网站服务协议》",{icon:2,time:2000}); 
		}
	});
	
	//获取验证码
	
	$("#log_getcode").click( function(){ 
		var mobile = $("#mobile").val();
		if($.isBlank(mobile)){
			layer.msg("请输入号码！", {icon : 2});
		}else {
			$.getJSON("#(path)/sys/sendCode?mobile="+mobile, function(data) {
				console.log(data);
				if(data.code=='success'){
					layer.msg(data.msg, {icon:1},function(){
					});
				}else if(data.code=='error'){
					layer.msg(data.msg, {icon : 2});
				}
			});
		}
	});
	
	
	var wait=60;  
	function time(o) {  
		if (wait == 0) {  
			o.removeAttribute("disabled");            
			o.value="获取验证码";  
			wait = 60;  
		} else {  
			o.setAttribute("disabled", true);  
			o.value="(" + wait + ")";  
			wait--;  
			setTimeout(function() {  
				time(o)  
			},  
			1000)  
		}  
	}  
	//获取url中"?"符后的字串
	function GetRequest() {  
	   var url = location.search;   
	   var theRequest = new Object();  
	   if (url.indexOf("?") != -1) {  
		  var str = url.substr(1);  
		  strs = str.split("&");  
		  for(var i = 0; i < strs.length; i ++) {  
			 theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);  
		  }  
	   }  
	   return theRequest;  
	}  
</script>